{% load bootstrap_form from bootstrap3 %}
{% load i18n %}
{% load staticfiles %}

<form method="post" action="{% url 'account_login' %}" novalidate>
  {% csrf_token %}
  <fieldset>
    {% bootstrap_form form %}
    {% if redirect_field_value %}
      <input type="hidden" name="next" name="{{ redirect_field_name }}"
             value="{{ redirect_field_value }}"/>
    {% endif %}
  </fieldset>
  <div class="row login__btn-group">
    <div class="col-sm-12">
      <button class="btn primary narrow">
        {% trans "Log in" context "Login form primary action" %}
      </button>
      <a class="link--styled" href="{% url 'account_reset_password' %}">
        {% trans "Forgot password?" context "Login form secondary link" %}
      </a>
      {% with available_backends=settings.available_backends %}
      <hr>
      <div class="row">
        <div class="col-sm-6 col-md-12 col-xl-6">
          {% if 'facebook' in backends.backends and 'facebook' in available_backends %}
            <a class="btn social-btn facebook" href="{% url 'social:begin' 'facebook' %}">
              <svg data-src="{% static "images/facebook.svg" %}" width="18" height="18" />
              <small>{% trans 'Facebook' %}</small>
            </a>
          {% endif %}
        </div>
        <div class="col-sm-6 col-md-12 col-xl-6">
          {% if 'google-oauth2' in backends.backends and 'google-oauth2' in available_backends %}
            <a class="btn social-btn google" href="{% url 'social:begin' 'google-oauth2' %}">
              <svg data-src="{% static "images/google.svg" %}" width="18" height="18" />
              <small>{% trans 'Google' %}</small>
            </a>
          {% endif %}
        </div>
      </div>
    {% endwith %}
    </div>
  </div>
</form>
